package com.qriver.session.service;

import com.qriver.session.entity.UserEntity;
import com.qriver.session.mapper.UserMapper;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    public UserEntity queryUserForLogin(String username, String password){
        if(StringUtils.isEmpty(username) || StringUtils.isEmpty(password)){
            return null;
        }
        UserEntity user = new UserEntity();
        user.setUsername(username);
        user.setPassword(password);
        return userMapper.queryUser(user);
    }

}
